import { http } from '@/utils/http.ts'
import type { BannerItem, CategoryItem, HotGoods,GuessGoodsItem } from '@/types/home'
import type { pageResult,pageParams } from '@/types/global'
// 广告区域
export const getHomeBannerApi = (distributionSite = 1) => {
  return http<BannerItem[]>({
    url: '/home/banner',
    method: 'GET',
    data: {
      distributionSite,
    },
  })
}

// 前台首页数据
export const getCategoryItemApi = () => {
  return http<CategoryItem[]>({
    url: '/home/category/mutli',
    method: 'GET',
  })
}

// 获取热门商品
export const getHomeHotGoodsApi = () => {
  return http<HotGoods[]>({
    url: '/home/hot/mutli',
    method: 'GET',
  })
}

// 获取猜你喜欢商品
export const getHomeGoodsGuessApi = (data? : pageParams) => {
  return http<pageResult<GuessGoodsItem>>({
    url: '/home/goods/guessLike',
    method: 'GET',
    data,
  })
}
